Skip to content

Specify differences between componentUpdated and update #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 15, 2016

Conversation

posva
Copy link
Member

@posva posva commented Oct 15, 2016

No description provided.

@phanan
Copy link
Member

phanan commented Oct 15, 2016

IMHO the change still doesn't tell the difference between componentUpdated and update. Nevertheless, the whole idea may be better explained with a note instead of an inline, as it involves two hooks instead of only componentUpdated itself. I'd rewrite what Evan said in the channel into something like this:

Though pretty much similar, update and componentUpdated has a subtle difference: When update is called on an element, there’s no guarantee whether its children have also been updated. On the other hand, when componentUpdated is called, the children would have been updated as well. Hence, if your directive relies on its children being already updated, use componentUpdated instead of update.

It's a bit wordy, though. Maybe you guys can shorten it somehow.

@chrisvfritz
Copy link
Contributor

@posva @phanan I just made some tweaks to try to simplify the language. What do you think?

@posva
Copy link
Member Author

posva commented Oct 15, 2016

it's better. I'll still add the tip that @phanan said

@chrisvfritz
Copy link
Contributor

@posva Do you think the tip is still necessary with the bolding? I tried to capture the content of the tip there.

@posva
Copy link
Member Author

posva commented Oct 15, 2016

@chrisvfritz No, sorry, it's fine like that. If people find it unclear we can add the tip later on

@chrisvfritz chrisvfritz merged commit 58042eb into vuejs:master Oct 15, 2016
@chrisvfritz
Copy link
Contributor

Sounds good. 🙂 Thanks for making this happen!

dingyiming added a commit to volksbright/document-standard-vue that referenced this pull request Oct 17, 2016
* master:
  Specify differences between componentUpdated and update (vuejs#510)
  update to vue 2.0.3 (vuejs#509)

# Conflicts:
#	src/guide/custom-directive.md
#	themes/vue/_config.yml
Peter-WF pushed a commit to Peter-WF/vuefe.github.io that referenced this pull request Nov 18, 2016
* Specify differences between componentUpdated and update

* better differentiate directive `update` and `componentUpdated`
Peter-WF pushed a commit to Peter-WF/vuefe.github.io that referenced this pull request Nov 18, 2016
* master:
  Specify differences between componentUpdated and update (vuejs#510)
  update to vue 2.0.3 (vuejs#509)

# Conflicts:
#	src/guide/custom-directive.md
#	themes/vue/_config.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants